// CoursePreRequisite.h: interface for the CoursePreRequisite class.
//
//////////////////////////////////////////////////////////////////////

#ifndef COURSEPREREQUISITE_H
#define COURSEPREREQUISITE_H
#include "../Shered/Object.h"
#include "Course.h"

/**
  * class CoursePreRequisite
  * links a course with a PreRequisite (another course)
  * holds refernce to both courses
  * main key is course ID and PreRequisite course ID
  */

class CoursePreRequisite  : virtual public Object
{
public:
	// Constructors/Destructors
	//main ctor
	CoursePreRequisite(Course &course,Course &prerequisite):m_course(course),m_PreRequisite(prerequisite){;}
	//copy ctor
	CoursePreRequisite(const CoursePreRequisite &c):m_course(c.m_course),m_PreRequisite(c.m_PreRequisite){;}
	//dtor
	virtual ~CoursePreRequisite();
	
	//comparison operator with Course (on course ID key)
	bool operator==(const Course &rhs){return(m_course==rhs);}
	//comparison operator on main key
	bool operator==(const CoursePreRequisite &rhs){return((m_course==rhs.m_course)&&(m_PreRequisite==rhs.m_PreRequisite));}
	
	//getters
	Course & getCourseRef()const{return m_course;}
	Course & getPreRequisite()const{return m_PreRequisite;}
private:
	//the course
	Course &m_course;
	//the PreRequisite for course
	Course &m_PreRequisite;
	//Empty Constructor (deprecated)
	CoursePreRequisite();
};
#endif // COURSEPREREQUISITE_H